<template>
	<w-layout showNavbar navTitle="领主接力" :navTitleColor="publicStyles['--color-t1']" background="url('/static/image/bk.png') no-repeat"
		navBackgroundColor="transparent" :scrollTop="page.scrollTop" :navScrollColor="publicStyles['--color-bk']">
		<template #default>
			<view class="container">
				<view class="">
					<view class="public-card-2 px-50 py-50 mt-40">
						<view class="fr-ac-jsb">
							<view class="fs-32">
								挑战领主获得精粹福利
							</view>
						</view>
						<view class="fr-ac-jsb mt-30">
							<view class="">
								<text class="op-50">万家每挑战一发，领主可获得</text>
								<text class="color ml-8">精粹x20</text>
							</view>
						</view>
					</view>
				</view>
				<view class="px-100 mt-40">
					<up-tabs
						@change="tabChange"
						:list="tabs.list" 
						:current="tabs.current"
						lineWidth="14"
						lineHeight="14"
						:lineColor="`url('/static/icon/public/top-fill.png') 100% 100%`"
						:activeStyle="{
							color: publicStyles['--color'],
							fontWeight: 'bold',
							transform: 'scale(1.2)'
						}"
						:scrollable="false"
						itemStyle="height: 60px;"
						:inactiveStyle="{
							'font-size': '32rpx',
						}"
					>
					</up-tabs>
				</view>
				
				<!-- 挑战人数 -->
				<template v-if="tabs.current == 0">
					<view class="gap-40 mt-40" style="display: grid;grid-template-columns: repeat(3,1fr);">
						<view class="fr-ac" v-for="(item,index) in 50" :key="index">
							<image style="width: 80rpx;height: 80rpx;border-radius: 50%;" src="/static/logo.png" mode=""></image>
							<view class="flex-1 ellipsis-1 ml-15 op-90">
								名字名字名字名字名字
							</view>
						</view>
					</view>
				</template>
				
				<!-- 领主记录 -->
				<template v-if="tabs.current == 1">
					<view class="mt-40 u-border-bottom pb-30 fr-ac" style="border-color: var(--gray-line) !important;" v-for="(item,index) in state.list" :key="index">
						<image style="width: 80rpx;height: 80rpx;border-radius: 50%;" src="/static/logo.png" mode="widthFix"></image>
						<view class="w-30 ellipsis-1 ml-15 op-90">
							名字名字名字名字名字
						</view>
						<view class="ml-25 op-90">
							占领领主
						</view>
						<view class="ml-auto op-90">
							8天 23:34:12
						</view>
					</view>
				</template>
				
			</view>
		</template>
	</w-layout>
</template>

<script setup>
	import {
		ref,
		reactive,
		onMounted,
		computed,
		nextTick
	} from 'vue'
	import {
		storeToRefs
	} from 'pinia'
	import {
		onLoad, onPageScroll
	} from '@dcloudio/uni-app'
	import {
		useAppStore
	} from '@/store/app'
	import {
		useColorStore
	} from '@/store/color'
	import {
		
	} from '@/utils/request/api';
	import {
		useUserStore
	} from '@/store/user'
	const userStore = useUserStore()
	const appStore = useAppStore()
	const colorStore = useColorStore()
	const {
		publicStyles
	} = storeToRefs(colorStore)
	onLoad(async(options) => {
	})
	onMounted(() => {
		appStore.loadingHandler(false)
	})
	onPageScroll((e)=>{
		page.scrollTop = e.scrollTop
	})
	const page = reactive({
		scrollTop:0
	})
	
	const tabs = reactive({
		current:0,
		list:[
			{
				id:'',
				name:'挑战人数',
			},
			{
				id:'',
				name:'领主记录',
			}
		]
	})
	function tabChange(e){
		tabs.current = e.index
		console.log(tabs.current)
	}
	
	
	const state = reactive({
		list:[1,1],
		page:1,
		limit:15,
		last_limit:15,
	})
	function initData(){
		state.list = []
		state.page = 1
		state.last_limit = 15
	}
	
</script>

<style lang="scss">
	.shadow {
		box-shadow: 2rpx 2rpx 12rpx var(--shadow);
	}
	.color{
		color: var(--color);
	}

	.container {
		width: 100%;
		min-height: 100%;
		position: relative;
		overflow: hidden;
		box-sizing: border-box;
		padding: 0 30rpx;
		
	}
</style>